import request from "@/utils/request";

//用户注册请求
export const userRegisterService = (data) => {
  request.post("/api/reg", data);
};

//用户登录请求
export const userLoginService = (data) => {
  return request.post("/api/login", data);
};

//获取用户基本信息
export const getUserInfoService = () => {
  return request.get("/my/userinfo");
};

//更新用户基本信息
export const updateUserInfoService = (data) => {
  return request.put("/my/userinfo", data);
};

//更新用户密码
export const updateUserPwdService = (data) => {
  return request.patch("/my/updatepwd", data);
};

//更新用户头像

export const updateUserAvatar = (data) => {
  return request.patch("/my/update/avatar", {
    avatar: data,
  });
};
